<?php
session_start();
/* Program: ChooseGroceryLabel.php */
	if (isset($_SESSION['auth'])) {
		if($_SESSION['auth'] == "yes") 
		{
			
		} else {
			echo ("hello hacker ... got you ...");  
			exit();
		}
	} else {
	echo ("hello hacker ... got you ..."); 
	exit();
	}

if(@$_POST['newbutton'] == "Return to category page"
	or @$_POST['newbutton'] == "Cancel")
{
	header("Location: ChooseGroceryCat.php");
}
include("misc.inc");
include("functions.inc");
$cxn = mysqli_connect($host,$user,$passwd,$dbname)
	or die ("Couldn't connect to server");

if(trim($_POST['category']) == "new")
{
	$_POST['category']=trim($_POST['newCat']);
	if(empty($_POST['newCat'])
		or empty($_POST['newDesc'])	)
	{
		include("NewCat_form.inc");
		exit();
	}
	else
	{
		addNewType($_POST['newCat'],$_POST['newDesc'],$cxn);
	}
}
include("NewLabel_form.inc");
?>